package com.qyy.springblog.mapper;

import com.qyy.springblog.model.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

    //根据用户名，查询用户信息\
    @Select("select * from user where user_name = #{userName} and delete_flag = 0")
    UserInfo selectByName(String userName);

    @Select("select *from user where id = #{userId} and delete_flag = 0")
    UserInfo selectById(Integer userId);

    @Insert("insert into user(user_name, password, github_url) values (#{userName},#{password},'https://gitee.com/Bwindmill')")
    Integer insert(UserInfo user);
}
